using System;
using System.Collections.Generic;
using System.Text;

namespace Xeml.Sampling
{
    public abstract class Column
    {
        protected string name;
        protected bool enabled;

        private Type dataType;
        protected Dictionary<string, Column> _subCols;
        protected bool _isContainerColumn;
        private string _displayName;

        private string _nodeDisplayName;

        public string NodeDisplayName
        {
            get
            {
                if (string.IsNullOrEmpty(_nodeDisplayName))
                    return name;
                else
                    return _nodeDisplayName;
            }
            set { _nodeDisplayName = value; }
        }


        public string DisplayName
        {
            get
            {
                if (string.IsNullOrEmpty(_displayName))
                    return name;
                else
                    return _displayName;
            }
            set
            {

                _displayName = value;
            }
        }


        public bool IsContainerColumn
        {
            get { return _isContainerColumn; }
            set { _isContainerColumn = value; }
        }

        public Dictionary<string, Column> SubColumns
        {
            get { return _subCols; }
        }

        public Type DataType
        {
            get { return dataType; }
            set { dataType = value; }
        }


        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                this.name = value;
            }
        }

        public bool Enabled
        {
            get
            {
                return this.enabled;
            }
            set
            {
                this.enabled = value;
            }
        }

        public Column()
        {
            _isContainerColumn = false;
            this._subCols = new Dictionary<string, Column>();
        }

        public abstract object ExtractRowValue(object extract);
    }
}
